"""The write up of the ticket challenge"""
import binascii
import base64
from tongsuopy.crypto.ciphers import Cipher, algorithms, modes


def main():
    """entry point"""
    # key = "***"
    iv = b"0123456789ABCDEFFEDCBA9876543210"

    # cipher = "***"
    cipher_bytes = base64.b64decode(cipher)

    c = Cipher(
        algorithms.SM4(key.encode("utf-8")),
        modes.CBC(binascii.unhexlify(iv)),
    )
    dec = c.decryptor()
    plain = dec.update(cipher_bytes)
    plain += dec.finalize()
    print(plain.decode("utf-8"))


if __name__ == "__main__":
    main()
